﻿// Decompiled with JetBrains decompiler
// Type: TaleWorlds.CampaignSystem.CharacterDevelopment.TraitObject
// Assembly: TaleWorlds.CampaignSystem, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
// MVID: E85F8C15-4DF6-4E9C-A58A-29177E40D07A
// Assembly location: D:\steam\steamapps\common\Mount & Blade II Bannerlord\bin\Win64_Shipping_Client\TaleWorlds.CampaignSystem.dll

using System.Collections.Generic;
using TaleWorlds.Core;
using TaleWorlds.Library;
using TaleWorlds.Localization;
using TaleWorlds.ObjectSystem;

#nullable disable
namespace TaleWorlds.CampaignSystem.CharacterDevelopment
{
  public sealed class TraitObject : PropertyObject
  {
    internal static void AutoGeneratedStaticCollectObjectsTraitObject(
      object o,
      List<object> collectedObjects)
    {
      ((MBObjectBase) o).AutoGeneratedInstanceCollectObjects(collectedObjects);
    }

    protected override void AutoGeneratedInstanceCollectObjects(List<object> collectedObjects)
    {
      base.AutoGeneratedInstanceCollectObjects(collectedObjects);
    }

    public static MBReadOnlyList<TraitObject> All => Campaign.Current.AllTraits;

    public int MinValue { get; private set; }

    public int MaxValue { get; private set; }

    public bool IsHidden { get; private set; }

    public TraitObject(string stringId)
      : base(stringId)
    {
    }

    public void Initialize(
      TextObject name,
      TextObject description,
      bool isHidden,
      int minValue,
      int maxValue)
    {
      this.Initialize(name, description);
      this.MinValue = minValue;
      this.MaxValue = maxValue;
      this.IsHidden = isHidden;
      this.AfterInitialized();
    }
  }
}
